<template>
	<view class="">
		<view class="box">
			<image :src="obj.img" mode="widthFix"></image>
			<view class="rightbox">
				<view class="name">
					{{obj.name}}
				</view>
				<view class="centerbox">
					<text class="danwei">￥</text>
					<text class="jiage">{{identity!=0?obj.distributors_price:obj.price}}</text>
					<text class="xiaoliang" v-if="obj.sale_num">
						销量：{{obj.sale_num}}
					</text>
				</view>
			</view>
		</view>
	</view>
</template>

<script>
	export default {
		props: {
			obj: {
				type: Object,
			}
		},
		data() {
			return {
				identity: uni.getStorageSync('identity')
			}
		},
		onLoad() {
			// this.identity = 
			// console.log(this.identity)
			// debugger
		}
	}
</script>

<style scoped lang="scss">
	.box {
		display: flex;
		margin-top: 20rpx;
		background-color: #FFFFFF;

		image {
			width: 150rpx;
			height: 150rpx;
		}

		.rightbox {
			margin-left: 20rpx;

			.name {
				font-family: SourceHanSansCN-Regular;
				font-size: 28rpx;
				color: #000000;
			}

			.centerbox {
				margin-top: 30rpx;

				.danwei {
					font-family: PingFang-SC-Heavy;
					font-size: 22rpx;
					color: #e13c35;
				}

				.jiage {
					font-family: PingFang-SC-Heavy;
					font-size: 36rpx;
					color: #e13c35;
					margin-left: 5rpx;
				}

				.xiaoliang {
					font-family: PingFang-SC-Medium;
					font-size: 18rpx;
					color: #838383;
					margin-left: 41rpx;
				}
			}

			.btn {
				width: 100rpx;
				height: 53rpx;
				background-color: #ffffff;
				border-radius: 27rpx;
				border: solid 2rpx #ee1616;
				font-family: PingFang-SC-Medium;
				font-size: 22rpx;
				color: #e13c35;
				line-height: 53rpx;
				text-align: center;
				margin-top: 37rpx;
				margin-left: 370rpx;
			}

			.addcar {
				width: 171rpx;
				height: 53rpx;
				background-color: #ffffff;
				border-radius: 27rpx;
				border: solid 2rpx #ee1616;
				font-family: PingFang-SC-Medium;
				font-size: 22rpx;
				color: #e13c35;
				line-height: 53rpx;
				text-align: center;
				margin-top: 37rpx;
				margin-left: 307rpx;
			}
		}
	}
</style>
